/*
 * @Author: wuyang
 * @Description: 
 * @Date: 2022-12-29 14:23:07
 * @LastEditors: wuyang
 * @LastEditTime: 2023-01-12 14:00:26
 * @FilePath: \vue-ts-vite\src\main.ts
 */

import { createApp } from 'vue'
import App from './App.vue'

// 全局样式
import './style.css'
const app = createApp(App);
// 路由
import router from "./router";
// Element plus 相关
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// svg 相关
import 'virtual:svg-icons-register'
import SvgIcon from './components/svgIcon/index.vue'
// 引入 animated 动画
import 'animate.css/animate.min.css' //引入
// 引入 motion 动画
import { MotionPlugin } from "@vueuse/motion";
// 全局进度条
import 'nprogress/nprogress.css'
// 引入
import { setupStore } from '@/store'
import { setupRouter } from '@/router'
//引入echarts
import * as echarts from 'echarts';
import vue3SeamlessScroll from 'vue3-seamless-scroll';
import './permission' // 登录鉴权
// 全局注册使用 element plus 的图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.config.globalProperties.$echarts = echarts


  const setupApp = async () => {
    const app = createApp(App)
  
    // store
    setupStore(app)
  
    // 创建路由
    setupRouter(app)
  
    // setupElementPlus(app)
    app.use(vue3SeamlessScroll)
    
    app.use(MotionPlugin)
  
    app.component('svg-icon', SvgIcon)
  
    app.mount('#app')

  }
  
  setupApp()
  
